


clear all
cap log close
set more off
set matsize 1600
set mem 100m

global ROOT ""
global data "$ROOT/Data"
global dofiles "$ROOT/DoFiles"
global tables "$ROOT/Tables"
global figures "$ROOT/Figures"

use "$data/analysis_anthro.dta", clear

*************************************************************************************************************************************
*Declaring Globals
**************************************************************************************************************************************
global regressors_haz "wgonly_o gender agemons_haz agemons_haz2   month_haz_2-month_haz_11" 
global regressors_waz "wgonly_o gender agemons_waz agemons_waz2   month_waz_2-month_waz_11" 
global regressors_whz "wgonly_o gender agemons_whz agemons_whz2  month_whz_2-month_whz_11" 

global toreport "wgonly_o " 



cd "$tables"
*****************************************************************************
*Analysis of Height per Age
*****************************************************************************


matrix coeff = J(1,3,.)
matrix colnames coeff = "Height-for-age" "Weight-for-age" "Weight-for-height" 
matrix CI1 = J(2,3,.)
matrix colnames CI1 = "Height-for-age" "Weight-for-age" "Weight-for-height"
matrix rownames CI1 = ll95 ul95



display "-------- < 48 months ---------"
reg haz $regressors_haz if agemons_haz<48, cluster(zone_o)
matrix coeff[1,1]=e(b)[1,1]
boottest wgonly_o, boot(wild) seed(10101) bootcl(zone_o)
matrix CI1[1,1]=r(CI)[1,1]
matrix CI1[2,1]=r(CI)[1,2]



*****************************************************************************
*Analysis of Weight per Age
*****************************************************************************


display "-------- <48 months ---------"
reg waz $regressors_waz if agemons_waz<48, cluster(zone_o)
matrix coeff[1,2]=e(b)[1,1]
boottest wgonly_o, boot(wild) seed(10101) bootcl(zone_o)
matrix CI1[1,2]=r(CI)[1,1]
matrix CI1[2,2]=r(CI)[1,2]

*****************************************************************************
*Analysis of Weight per Height
*****************************************************************************

display "-------- 0 - 48 months ---------"
reg whz $regressors_whz if agemons_whz<48, cluster(zone_o)
matrix coeff[1,3]=e(b)[1,1]
boottest wgonly_o, boot(wild) seed(10101) bootcl(zone_o)
matrix CI1[1,3]=r(CI)[1,1]
matrix CI1[2,3]=r(CI)[1,2]

coefplot (matrix(coeff[1,]), ci(CI1)),  xline(0)  ciopts(recast(rcap)) citop 
graph save "$figures/anthro_treat_control", replace
graph export "$figures/anthro_treat_control.pdf", replace

cap log c
exit





